package java_persistence;

import java.util.List;

import org.apache.ibatis.annotations.Param;


/**
 * @author joseph simoneau <simoneau@gatech.edu>
 *
 */
public interface AppointmentMapper {

	// CREATES
	
	/**saves an Appointment's worth of information to the database.  
	 * @param date the date of the appointment as a POJO String in the format "YYYY-MM-DD HH:MM:SS"
	 * @param complaint the complaint
	 * @param rdu username of the requested doctor
	 * @param pu username of the patient
	 */
	public void create(@Param("date") String date, @Param("complaint") String complaint, @Param("req_dr_username") String rdu, @Param("patient_username") String pu);
	
	// RETRIEVES
	
	/**Retrieves the requested doctor username for an appointment on date held by patient_username.
	 * @param date the date of the appointment
	 * @param patient_username the username of the patient going to the appointment
	 * @return the username of the requested doctor for the appointment
	 */
	public String get_requested_doctor_username(@Param("date") String date, @Param("patient_username") String patient_username);
	/**Retrieves the complaint for an appointment on date held by patient_username.
	 * @param date the date of the appointment
	 * @param patient_username the username of the patient
	 * @return the complaint
	 */
	public String get_complaint(@Param("date")String date, @Param("patient_username") String patient_username);
	/**Retrieves a list of all dates that patient with username pu had or has scheduled
	 * @param pu the usenrame of the patient
	 * @return a list of dates, each with the format "YYYY-MM-DD HH:MM:SS"
	 */
	public List<String> get_appointment_dates(@Param("patient_username")String pu);
	
	// UPDATES 
	
	/**Updates the entry in the database.  Note that the patient username (pu) and date of the appointment (date) must already have been saved and cannot be changed, they are used to uniquely idenitfy the appointment in the database.
	 * @param date the date of the appointment (SHOULD NOT BE CHANGED FROM THE ORIGINAL VALUE SAVED)
	 * @param complaint the complaint
	 * @param rdu the username of the requested doctor
	 * @param pu the username of the patient (SHOULD NOT BE CHNAGED FROM THE ORIGINAL VALUE SAVED)
	 */
	public void update(@Param("date") String date, @Param("complaint") String complaint, @Param("req_dr_username") String rdu, @Param("patient_username") String pu);
		
	// DELETES
	
	/**Deletes the appointment from the database.
	 * @param date the date of the appointment
	 * @param pu the username of the patient. 
	 */
	public void delete(@Param("date") String date, @Param("patient_username") String pu );

	
	
}
